package com.woniuxy.cloud.carl.order.client;

import com.woniuxy.cloud.carl.order.client.param.FindServiceByTypeParam;
import com.woniuxy.cloud.carl.order.client.result.FirstTypeDto;
import com.woniuxy.cloud.carl.order.client.result.SecondTypeDto;
import com.woniuxy.cloud.carl.order.client.result.ServiceDetailDto;
import com.woniuxy.cloud.carl.order.client.result.ThirdTypeDto;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "serviceQueryClient",path = "order",name = "order")
public interface ServiceQueryClient {

    @GetMapping("findServiceDetail")
    public Result<ServiceDetailDto> findServiceDetail(@RequestParam("serviceId") Long serviceId);

    @GetMapping("findFirstType")
    public Result<List<FirstTypeDto>> findFirstType();

    @GetMapping("findSecondByFirst")
    public Result<List<SecondTypeDto>> findSecond(@RequestParam("firstTypeId") Long firstTypeId);

    @GetMapping("findThirdBySecond")
    public Result<List<ThirdTypeDto>> findThird(@RequestParam("secondTypeId") Long secondTypeId);

    @GetMapping("/findServiceByType")
    Result<List<ServiceDetailDto>> findServiceByType(@SpringQueryMap FindServiceByTypeParam param);
}
